package cn.patpang.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Properties;

/**
 * @Title Constants.java
 * @Author pat pang
 * @Data 2017年6月23日 下午4:15:34
 */
@Component
public class SystemConstants {

    public static String WEI_XIN_APPID;
    public static String WEI_XIN_APPSECRET;
    public static String SESSION_ADMIN_USER_KEY;
    public static String SESSION_API_USER_INFO;

    static {
        try {
            Properties properties = new Properties();
            properties.load((new InputStreamReader(HttpResultMessage.class.getClassLoader().getResourceAsStream("commons.properties"), "UTF-8")));

            WEI_XIN_APPID = properties.getProperty("weixin.appid");
            WEI_XIN_APPSECRET = properties.getProperty("weixin.appsecret");
            SESSION_API_USER_INFO = properties.getProperty("session.api.user.info");
            SESSION_ADMIN_USER_KEY = properties.getProperty("session.admin.user.info");


        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}